package com.atao.baokede.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.IOException;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Cart {
    private static final ObjectMapper objectMapper = new ObjectMapper();
    /**
     * 购物车条目id
     */
    private Long id;
    /**
     *用户id
     */
    private Long userId;
    /**
     *商品id
     */
    private Long itemId;
    /**
     *购买数量
     */
    private Long num;
    /**
     *商品标题
     */
    private String name;
    /**
     *商品动态属性键值集（如尺寸，大小，款式）
     */
    private String spec;
    /**
     *价格
     */
    private BigDecimal price;
    /**
     *商品图片
     */
    private String image;
    /**
     *商品状态
     */
    private Integer status;
    /**
     *创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     *更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}
